summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2012-05-03 22:20:35 +0000
committerMike Buland <mike@xagasoft.com>2012-05-03 22:20:35 +0000
commit75b3ad661c2d6ed382620a25613846c2b2b10f46 (patch)
tree7f38d38adef79becf14df243b721bf5699e80245
parent105aa3262bde83a33394ec57401ecf53e8d81971 (diff)
downloadstage-75b3ad661c2d6ed382620a25613846c2b2b10f46.tar.gz
stage-75b3ad661c2d6ed382620a25613846c2b2b10f46.tar.bz2
stage-75b3ad661c2d6ed382620a25613846c2b2b10f46.tar.xz
stage-75b3ad661c2d6ed382620a25613846c2b2b10f46.zip
Misc updates.
-rw-r--r--.gitignore4
-rw-r--r--bloodfields.stage2
-rw-r--r--default.bld11
-rw-r--r--sml-help.sml18
-rw-r--r--src/options.cpp25
-rw-r--r--support/vim/syntax/stage.vim2
6 files changed, 53 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 9b9c783..2ccb45d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,7 @@ stage*.zip
6*.o 6*.o
7*.win_o 7*.win_o
8libbu++ 8libbu++
9libgats
10src/datafiles.cpp
11src/datafiles.h
12*.dll
diff --git a/bloodfields.stage b/bloodfields.stage
index bfef7ba..861fdb7 100644
--- a/bloodfields.stage
+++ b/bloodfields.stage
@@ -98,7 +98,7 @@ function mkEnemy()
98 global.enemy = global.enemyTypes[eid]; 98 global.enemy = global.enemyTypes[eid];
99 99
100 mod = player.level; 100 mod = player.level;
101 if mod > count(global.enemyMods) then 101 if mod > count(global.enemyMods) - 1 then
102 { 102 {
103 mod = count(global.enemyMods); 103 mod = count(global.enemyMods);
104 } 104 }
diff --git a/default.bld b/default.bld
index b35ee6a..6f9feeb 100644
--- a/default.bld
+++ b/default.bld
@@ -10,7 +10,7 @@ if exists("src/parser.tab.cpp") then
10 10
11action "default" 11action "default"
12{ 12{
13 build: ["src/version.h", "stage"]; 13 build: ["src/version.h", "src/datafiles.h", "stage"];
14} 14}
15 15
16target "src/version.h" 16target "src/version.h"
@@ -41,6 +41,15 @@ target "src/version.h"
41 } 41 }
42} 42}
43 43
44target "src/datafiles.h"
45{
46 input ["sml-help.sml"];
47 profile "build"
48 {
49 execute("bin2cpp -d src -f deflate sml-help.sml");
50 }
51}
52
44CC="g++"; 53CC="g++";
45target "stage" 54target "stage"
46{ 55{
diff --git a/sml-help.sml b/sml-help.sml
new file mode 100644
index 0000000..74ac686
--- /dev/null
+++ b/sml-help.sml
@@ -0,0 +1,18 @@
1SML - STAGE Markup Language help[break][break]
2SML has two types of tags, unary tags stand on their own and are fenced by
3square brackets like \[break]. Putting a \[braek] in anywhere will add a
4paragraph break. This is the only way to insert a newline manually, as SML will
5reformat your text to fit the available space automatically.
6[break]
7There are also binary tags, which contain text and let you change the formatting
8in a variety of ways. For example, you can set the [yellow>color of some
9text<yellow]. Binary tags start with \[tagname> and end with \<tagname].
10[break][break]
11Color tags:[break]
12\[green>[green>Green<green]\<green] [break]
13\[red>[red>Red<red]\<red] [break]
14\[yellow>[yellow>Yellow<yellow]\<yellow] [break]
15\[blue>[blue>Blue<blue]\<blue] [break]
16\[magenta>[magenta>Magenta<magenta]\<magenta] [break]
17\[cyan>[cyan>Cyan<cyan]\<cyan] [break]
18\[white>[white>White<white]\<white]
diff --git a/src/options.cpp b/src/options.cpp
index 93a29bc..3fff4dc 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -11,6 +11,7 @@
11#include <bu/sio.h> 11#include <bu/sio.h>
12#include <gats/gatsstream.h> 12#include <gats/gatsstream.h>
13#include <gats/types.h> 13#include <gats/types.h>
14#include "datafiles.h"
14 15
15#include <bu/deflate.h> 16#include <bu/deflate.h>
16 17
@@ -108,7 +109,7 @@ int Options::smlTest( Bu::Array<Bu::String> aArgs )
108 fIn.close(); 109 fIn.close();
109 110
110 SmlNode *pRoot = SmlNode::parse( sContent ); 111 SmlNode *pRoot = SmlNode::parse( sContent );
111 sio << *pRoot << sio.nl; 112// sio << *pRoot << sio.nl;
112 113
113 try 114 try
114 { 115 {
@@ -130,12 +131,24 @@ int Options::smlTest( Bu::Array<Bu::String> aArgs )
130 131
131int Options::smlHelp( Bu::Array<Bu::String> aArgs ) 132int Options::smlHelp( Bu::Array<Bu::String> aArgs )
132{ 133{
133 Bu::File fIn("sml-help.sml.gz", Bu::File::Read ); 134 Bu::String sContent = Datafiles::getString("sml-help.sml");
134 Bu::Deflate dIn( fIn ); 135 SmlNode *pRoot = SmlNode::parse( sContent );
135 char buf[4096]; 136
136 buf[dIn.read( buf, 4096 )] = '\0'; 137 try
137 printf("%s\n", buf ); 138 {
139 InterfacePlugger &ip = InterfacePlugger::getInstance();
140 Interface *pIface = ip.instantiate( sInterface );
141 pIface->display( pRoot );
142 ip.destroy( pIface );
143 }
144 catch( Bu::HashException &e )
145 {
146 sio << "No such interface found." << sio.nl;
147 }
148
149 delete pRoot;
138 150
151 exit( 0 );
139 return 0; 152 return 0;
140} 153}
141 154
diff --git a/support/vim/syntax/stage.vim b/support/vim/syntax/stage.vim
index 6009d80..313760f 100644
--- a/support/vim/syntax/stage.vim
+++ b/support/vim/syntax/stage.vim
@@ -19,7 +19,7 @@ syn keyword Statement setup enter
19syn keyword Todo TODO FIXME XXX 19syn keyword Todo TODO FIXME XXX
20syn keyword Type function command situation game global player option 20syn keyword Type function command situation game global player option
21syn keyword Constant null true false 21syn keyword Constant null true false
22syn keyword Builtins display goto exists delete exit return random integer float string debugString keys join 22syn keyword Builtins display goto exists delete exit return random integer float string debugString keys join count
23 23
24syn cluster CommentGroup contains=Todo 24syn cluster CommentGroup contains=Todo
25 25